#!/bin/bash

appName=openapi3-doc
WORK_PATH=/opt/soft/microservices/${appName}
mkdir -p $WORK_PATH
mkdir -p /data/logs/microservices/${appName}

\cp -f * $WORK_PATH
\cp -f ${appName}.ini /etc/supervisord.d
rm  -f $WORK_PATH/install.sh

if [ ! -L $WORK_PATH/logs ]; then
    ln -s /data/logs/microservices/${appName} $WORK_PATH/logs
fi

mkdir -p /opt/soft/microservices/openapi3-doc/yaml

echo "安装完成后，请重启或者更新服务："
echo "supervisorctl restart ${appName}"
echo "or"
echo "supervisorctl update"
echo "请yaml API规范文档保存在/opt/soft/microservices/openapi3-doc/yaml目录中"

echo "URL: http://{serverName}/swagger-ui/index.html"
